package com.cskaoyan.controller.admin;

import com.cskaoyan.bean.vo.BaseRespVo;
import com.cskaoyan.bean.vo.DashboardVO;
import com.cskaoyan.service.DashboardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: zoey-zhu
 * @description: 首页
 * @Date 20:27 2021/7/8
 */
@RestController
@RequestMapping("admin")
public class DashboardController {

    @Autowired
    DashboardService dashboardService;

    /**
     * @Author: zoey-zhu
     * @description: 首页(GET)：查询订单、用户、货品、订单的数量
     * @Date 20:27 2021/7/8
     * url: http://182.92.235.201:8083/admin/dashboard
     */
    @GetMapping("/dashboard")
    public BaseRespVo dashboard() {

        DashboardVO data = dashboardService.dashboard();
        return BaseRespVo.ok(data);
    }
}
